Correct typo when outputting icons in route.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 25 Apr 2003 05:02:59 +0000 (05:02 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 25 Apr 2003 05:02:59 +0000 (05:02 +0000)
Force resync against VERSION packet, even if (especially if) we're
just coming out of a file read.

gpsbabel/magproto.c

index a6babe85bb964212dc606f1bf7a092458e09f53d..9b89ace7ba6263c661ce592fa964e8d339cad431 100644 (file)
@@ -38,6 +38,8 @@ static char * termread(char *ibuf, int size);
 static void termwrite(char *obuf, int size);
 static double mag2degrees(double mag_val);
 static void mag_readmsg(void);
+static void mag_handon(void);
+static void mag_handoff(void);
 static void *mkshort_handle;
 static char *deficon;
 static char *bs;
@@ -272,9 +274,11 @@ mag_writemsg(const char * const buf)
                        }
                        if (retry_cnt--)
                                goto retry;
-                       else
+                       else {
+                               mag_handoff();
                                fatal(MYNAME 
                                        ": Too many communication errors.\n");
+                               }
                }
        }
 } 
@@ -716,6 +720,7 @@ mag_rd_init(const char *portname, const char *args)
         */
        later = now + 6;
        if (!is_file) {
+               got_version = 0;
                mag_writemsg("PMGNCMD,VERSION");
        }
 
@@ -734,6 +739,7 @@ mag_rd_init(const char *portname, const char *args)
                 */
                ignore_unable = 1;
                mag_writemsg("PMGNCMD,NMEAOFF");
+               ignore_unable = 0;
        }
 
        QUEUE_INIT(&rte_wpt_tmp);
@@ -1163,7 +1169,7 @@ mag_waypt_pr(const waypoint *waypointp)
 
        isrc = waypointp->notes ? waypointp->notes : waypointp->description;
        owpt = global_opts.synthesize_shortnames ?
-                        mkshort(mkshort_handle, isrc) : waypointp->shortname,
+                        mkshort(mkshort_handle, isrc) : waypointp->shortname;
        odesc = isrc ? isrc : "";
        owpt = mag_cleanse(owpt);
 
@@ -1296,7 +1302,7 @@ mag_route_trl(const route_head * rte)
                
                if ((tmp == &rte->waypoint_list) || ((i % 2) == 0)) {
                        thisline++;
-                       
+
                        sprintf(obuff, "PMGNRTE,%d,%d,c,%d,%s,%s", 
                                numlines, thisline, rte->rte_num,
                                buff1, buff2);